/**
 * Mark Fedor
 * Tony Greseth
 * CS 5551 User Interface Design
 * Section 1
 * Sai Chittilla
 * Yahtzee Program
 */
package Yahtzee;

import java.io.*;

/**
 * This class represents a move in the Yahtzee game. It is used in the dice
 * class otherwise it doesn't hold much significance
 */
public class Move implements Serializable {

    /**
     * Constructs a new move by storing the row and column numbers
     * of a Yahtzee board.
     * @param row The row number of this move.
     * @param column The column number for this move.
     */
    public Move(Integer score,Integer index) {

	this.score = score;
	this.index = index;

    }

    /**
     * Checks for whether this move is valid. The row number must be a 
     * positive integer less than or equal to <b>Board.NUM_ROWS</b> and
     * the column number must be a positive integer less than or equal to 
     * <b>Board.NUM_COLUMNS</b>.
     * @return True if this move is valid, false otherwise.
     */
    public boolean isValid() {

	return (score >= 0 && index >= 0 && index < 13);

    }

    /**
     * Accessor for this move's row number.
     * @return This move's row number.
     */
    public Integer getScore() {

	return score;

    }

    /**
     * Accessor for this move's column number.
     * @return This move's column number.
     */
    public Integer getIndex() {

	return index;

    }

    /**
     * Constructs a string representation for this move.
     * @return A string representation for this move.
     */
    public String toString() {

	return "Score = " + score + ", Index = " + index;

    }

    private Integer score;
    private Integer index;

}
